162de509b25083dc02520c73bcaa084f41ded77d,src/main/java/com/continuuity/passport/dal/db/VpcDBAccess.java,VpcDBAccess,removeVPC,#number#,63

Before Change


      throw new ConfigurationException("DBConnection pool is null. DAO is not configured");
    }
    try {
      Connection connection= this.poolManager.getConnection();

      String SQL = String.format( "DELETE FROM %s WHERE %s = ?",
                                  DBUtils.VPC.TABLE_NAME,
                                  DBUtils.VPC.VPC_ID_COLUMN);
      PreparedStatement ps = connection.prepareStatement(SQL);

      ps.setInt(1,vpcId);
      ps.executeUpdate();

After Change


      throw new ConfigurationException("DBConnection pool is null. DAO is not configured");
    }
    try {
      connection = this.poolManager.getConnection();

      String SQL = String.format("DELETE FROM %s WHERE %s = ? and %s = ?",
        DBUtils.VPC.TABLE_NAME,
        DBUtils.VPC.VPC_ID_COLUMN,
        DBUtils.VPC.ACCOUNT_ID_COLUMN);

      ps = connection.prepareStatement(SQL);
      ps.setInt(1, vpcId);
      ps.setInt(2, accountId);

      int count = ps.executeUpdate();
      if (count == 0) {
        throw new VPCNotFoundException("VPC not found");
      }

    } catch (SQLException e) {